package com.xbongbong.pro.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import lombok.Getter;

@Getter
public enum PackageStatusEnum {

    UNAVAILABLE(0, "enum.packageStatus.memo.unavailable", null, null),

    NORMAL(1, "enum.packageStatus.memo.normal", 0F, 1F),

    WARNING(2, "enum.packageStatus.memo.warning", 1F, 1.1F),

    OVER(3, "enum.packageStatus.memo.over", 1.1F, null),

    ;

    /**
     * 套餐类型
     */
    private int code;

    /**
     * 解释
     */
    private String memo;

    /**
     * 当前状态最低使用量
     */
    private Float lowRate;

    /**
     * 当前状态最高使用量
     */
    private Float highRate;

    PackageStatusEnum(int code, String memo, Float lowRate, Float highRate) {
        this.code = code;
        this.memo = memo;
        this.lowRate = lowRate;
        this.highRate = highRate;
    }

    public String getMemo() {
        return I18nMessageUtil.getMessage(memo);
    }
}
